#ifndef PROTOTYPE_H
#define PROTOTYPE_H

#include "value.h"

typedef struct UpvalueDescribe
{
    TValue name;
    u_int stack;
    u_int position;
} UpvalueDescribe;

typedef struct Capture
{
    u_int begin;
    u_int end;
    u_int position;
} Capture;

typedef struct Local
{
    TValue name;
    u_int position;
    u_int begin;
    u_int end;
} Local;

typedef struct Prototype
{
    Chunk *chunk;
    Instruction *instructions;
    u_int numOfInstructions;
    u_int maxStackSize;
    Capture *captures;
    u_int numOfCaptures;
    UpvalueDescribe *upvalueDescribes;
    u_int numOfUpvalueDescribes;

    C_Function c_func;
    _int numOfParams;
} Prototype;

void Prototype_Init(Prototype *prototype);
void C_Prototype_Init(Prototype *prototype, C_Function c_func, _int numOfParams);

// T_ARRAY(ARRAY_FUNCTION, Prototype);

#endif